Skip to content

v7.0.0 #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 474 commits into from
Jun 25, 2025
Merged

v7.0.0 #103

merged 474 commits into from
Jun 25, 2025

Conversation

prc5
Copy link
Contributor

@prc5 prc5 commented May 1, 2025

feat: 🎸 New version of Hyper Fetch
BREAKING CHANGE: 🧨 Changes in the internal APIS, changes in the generic types for the requests

TODOS:

  • Update Readme for the new packages
  • Generate tags for the new packages to align the versioning
  • Create detailed release notes
  • Create migration guide
  • Add devtools plugin to the docs integrations
  • Finalize the documentation landing page
  • Generate current main branch version docs and lock it's version
  • @GerasNyx Get real adapter and url from the client
  • @GerasNyx Make all actions work in the hyper-flow
  • Check firebase - maybe simple example app?
  • @GerasNyx testing plugin-devtools
  • client generic type for adapter is not automatically passed into client
  • what is responseType and responseEncoding on the Request? - move it to adapter options
  • Add the comments in the code so the api docs are more rich
  • Query name on the graphql adapter
  • Codegen - remove client generation from it - replace it with import from "./client"
  • Eslint - check if it is possible to pass the interface to the generic of react without errors
  • Packages readme polishing
  • @GerasNyx Duplicated data in the devtools websockets - eventData and data - example: cache events

HyperFetch v7.0.0 Release Notes

This is a major release that brings a completely revamped developer experience, a new plugin system, and a host of other
improvements and breaking changes. The entire library has been modernized to provide a more robust and flexible
data-fetching solution.


✨ Highlights

🚀 Hyper Flow: The New DevTools

We are thrilled to introduce Hyper Flow, a brand-new, standalone Electron application that provides a powerful and
intuitive UI for debugging and visualizing your HyperFetch requests.

  • Real-time Monitoring: See all your requests, cache, and queue state in real-time.
  • Detailed Request Inspection: Dive deep into individual requests to see their data, headers, and timings.
  • Cache and Queue Management: Inspect and manage your cached data and request queues.
  • Data Visualization: Visualize your data flows and understand how your app interacts with your APIs.
  • And much more...

🔌 New Plugin System

HyperFetch now has a powerful plugin system that allows you to extend its functionality. The first official plugin is
@hyper-fetch/plugin-devtools, which connects your application to the new Hyper Flow DevTools.

ESLint Plugin

A new ESLint plugin (@hyper-fetch/eslint-plugin-hyper-fetch) is now available to help you enforce best practices and
avoid common pitfalls when using HyperFetch.

🧪 Testing Module

The new @hyper-fetch/testing module makes it easier than ever to test your data-fetching logic. It provides
out-of-the-box mocking for:

  • HTTP requests
  • GraphQL queries and mutations
  • Server-Sent Events (SSE)
  • WebSockets

💥 Breaking Changes

This release introduces several breaking changes. Please review them carefully before upgrading.

Core (@hyper-fetch/core)

  • Client and Request Creation:
    • The new Client() constructor is deprecated. Use the new createClient() function instead.
    • Use the new client.createRequest() method to build your requests. This new method provides improved type inference
      and a more fluent API.
  • TypeScript Strict Mode: The library now fully supports TypeScript's strict mode. This may cause type errors in
    your existing codebase if you are not using strict mode.
  • Immer Integration: We now use Immer for immutable state management. This should be a transparent change for most
    users, but it's a significant internal update.
  • Cache and Dispatcher: The caching and request dispatching systems have been heavily refactored for better
    performance and reliability.
  • cacheTime and staleTime: We've introduced cacheTime and staleTime options for more granular control over
    caching, similar to what you might know from other data-fetching libraries.
  • Default HTTP Adapter: The default HTTP adapter is now included in the @hyper-fetch/core package. You no longer
    need to install a separate adapter for basic HTTP requests.

React (@hyper-fetch/react)

  • Hooks API: The React hooks (useFetch, useSubmit, etc.) have been refactored. While the core functionality
    remains the same, there might be subtle changes in behavior and return values.
  • Hydration: We've introduced new and improved APIs for server-side rendering (SSR) hydration.
  • Provider: The ConfigProvider has been renamed to HyperFetchProvider for clarity.

Sockets (@hyper-fetch/sockets)

  • Adapters: The socket implementation has been completely rewritten. We now provide two separate adapters:
    • @hyper-fetch/socket-adapter-sse for Server-Sent Events.
    • @hyper-fetch/socket-adapter-ws for WebSockets.
  • Improved Error Handling: Error handling for socket connections has been significantly improved.

Adapters (@hyper-fetch/adapter-*)

  • All adapters (axios, firebase, firebase-admin, graphql) have been updated to be compatible with the new core
    changes. You will need to update them to their latest versions.

Build System

  • We have dropped support for CommonJS (CJS). HyperFetch is now an ESM-only library. You will need to ensure your build
    system is configured to handle ESM packages.

📦 New Packages

  • @hyper-fetch/hyper-flow: The new DevTools application.
  • @hyper-fetch/plugin-devtools: The plugin to connect your app to Hyper Flow.
  • @hyper-fetch/eslint-plugin-hyper-fetch: The new ESLint plugin.
  • @hyper-fetch/testing: The new testing module.

Upgrading

To upgrade to v6.0.0, you will need to update all the HyperFetch packages you are using to their latest versions.

npm install @hyper-fetch/core@latest @hyper-fetch/react@latest ...
# or
yarn add @hyper-fetch/core@latest @hyper-fetch/react@latest ...

We recommend carefully reviewing the updated documentation and examples to understand how to adapt your code to the new
APIs.

prc5 and others added 23 commits June 22, 2025 21:53
* tmp push

* Plugin + Server refactor, minus tests

* import fix

* First server test fix

* Export fix

* minor fixes

* Connection message fix

* Corrected APP_INITIALIZATION message

* progress

* Fixed information passing

* progress

* Fixed external triggering

* progress

* progress

* Fixed socket emitting

* TS fixes

* progress

* progress

* progress

* progress

* progress

* progress

* conn fixes

* fix: 🐛 console log

* progress

---------

Co-authored-by: Kacper Skawina <[email protected]>
Co-authored-by: Maciej Pyrc <[email protected]>
@prc5 prc5 changed the base branch from main to v7.0.0 June 25, 2025 12:46
@prc5 prc5 merged commit da7ec12 into v7.0.0 Jun 25, 2025
1 of 3 checks passed
prc5 added a commit that referenced this pull request Jun 25, 2025
Copy link

🎉 This PR is included in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@prc5 prc5 deleted the 6.0.0 branch June 26, 2025 07:04
@prc5 prc5 restored the 6.0.0 branch June 26, 2025 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants